package com.yunhe.serviceImpl;

import com.yunhe.javabean.Permission;
import com.yunhe.mapper.PermissionMapper;
import com.yunhe.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("permissionService")
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;


    @Override
    public List<Permission> findAll() {
        return permissionMapper.selectAll();
    }

    @Override
    public Permission findById(Integer id) {
        return permissionMapper.selectById(id);
    }

    @Override
    public int edit(Permission permission) {
        return permissionMapper.updateById(permission);
    }

    @Override
    public int add(Permission permission) {
        return permissionMapper.insert(permission);
    }

    @Override
    public int delete(Integer id) {
        return permissionMapper.deleteById(id);
    }

    @Override
    public List<Permission> findByUid(Integer uid) {
        return permissionMapper.selectByUid(uid);
    }

}
